package com.atguigu.gmall.order.service;

import com.atguigu.gmall.model.enums.ProcessStatus;
import com.atguigu.gmall.model.order.OrderInfo;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Map;

public interface OrderService extends IService<OrderInfo> {
    Long saveOrderInfo(OrderInfo orderInfo);

    //    生成流水号
    String getTradeNo(String userId);

    //    比较流水号
    boolean checkTradeNo(String tradeNO, String userId);

    //    删除流水号
    void deleteTradeNo(String userId);

    boolean checkStock(Long skuId, Integer skuNum);

    void execExpiredOrder(Long orderId);

    void execExpiredOrder(Long orderId, String flag);

    void updateOrderStatus(Long orderId, ProcessStatus processStatus);

    OrderInfo getOrderInfo(Long orderId);

    void sendOrderStatus(Long orderId);

    Map initWareOrder(OrderInfo orderInfo);

    List<OrderInfo> orderSplit(Long orderId, String wareSkuMap);
    /**
     * 记录订单状态日志
     * @param orderId
     * @param orderStatus
     */
    void saveOrderStatusLog(Long orderId, String orderStatus);

}
